package uit.com.project.iCampus.application;

import java.util.ArrayList;
import java.util.List;

import org.xmlrpc.android.XMLRPCClient;

import uit.com.project.iCampus.model.BuildingInfo;
import uit.com.project.iCampus.model.User;
import android.app.Activity;
import android.app.Application;
import android.app.ProgressDialog;

import com.google.android.maps.GeoPoint;

public class ICampusApp extends Application {
//	public static final String SERVER_ADDRESS = "http://example.dyndns.info:8080/iCampus_Server/xmlrpc";
	public static final String SERVER_ADDRESS = "http://10.0.2.2:8080/iCampus_Server/xmlrpc";
	public static XMLRPCClient XML_RPC_CLIENT;
	public static ProgressDialog PROGRESS_DIALOG = null;
	public static String[] ACTIVITIES = new String[]{};
	public static String NULL_VALUE;
	public static boolean FIRST_START = true;
	public static boolean NEED_UPDATE = false;
	
	
	public static Activity PREV_ACTIVITY;
	public static User CURRENT_USER = null;
	
	public static BuildingInfo CURRENT_BUILDINGINFO = null;
	public static List<BuildingInfo> LIST_BUILDINGCENTER_IN_AREA = new ArrayList<BuildingInfo>();
	public static List<BuildingInfo> LIST_BUILDING_FOOD_IN_AREA = new ArrayList<BuildingInfo>();
	public static List<BuildingInfo> LIST_BUILDING_TRAMS_IN_AREA = new ArrayList<BuildingInfo>();
	public static List<BuildingInfo> LIST_BUILDING_University_IN_AREA = new ArrayList<BuildingInfo>();
	public static List<BuildingInfo> LIST_BUILDING_Softdrink_IN_AREA = new ArrayList<BuildingInfo>();
	public static List<BuildingInfo> LIST_BUILDING_HighBuilding_IN_AREA = new ArrayList<BuildingInfo>();
	
	
	//Using for Google Map
	public static GeoPoint DESTINATION = null;
	public static GeoPoint MY_LOCATION = new GeoPoint((int)(10.870485 * 1E6), (int)(106.802065 * 1E6));
//	public static GeoPoint MY_LOCATION = null;,
	public static boolean SHOW_DIRECTION_PATH = false;
	public static int CIRCLE_RADIUS = 2000;
	
	
	@Override
	public void onCreate() {
		super.onCreate();
		XML_RPC_CLIENT = new XMLRPCClient(SERVER_ADDRESS);
	}
	
	@Override
	public void onTerminate() {
		super.onTerminate();
		// logout here => delete useronline
	}
}
